//
//  UIButton+YZSetImage.m
//  VET
//
//  Created by 刘文靖 on 2018/7/27.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "UIButton+YZSetImage.h"

@implementation UIButton (YZSetImage)
- (void)yz_setImage:(NSString *)imagePath{
    UIImage * image = [UIImage imageNamed:imagePath];
    [self setImage:image forState:UIControlStateNormal];
}

- (void)yz_setBGImage:(NSString *)imagePath{
    UIImage * image = [UIImage imageNamed:imagePath];
    image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(image.size.height / 2 - 1, image.size.width / 2 - 1, image.size.height / 2 - 1, image.size.width / 2 - 1) resizingMode:UIImageResizingModeStretch];
    [self setBackgroundImage:image forState:UIControlStateNormal];
}
@end
